DEFINITION MODULE VInput;

(*
VDI Input Functions.

UK __DATE__ __TIME__
*)

(*DEF_SWITCHES*)

FROM VDI    IMPORT XY,Key,SpecialKey;
FROM PORTAB IMPORT UNSIGNEDWORD,SIGNEDWORD,WORDSET,ANYWORD,ANYTYPE;

(* [V]DI: [S]et [In]put [Mode] *********************************************)

begin_word
TYPE Devices = (ResvdDev,Locator,Valuator,Choice,String);

     InputModes = (ResvdMode,Request,Sample);
end_word

PROCEDURE VSInMode(Handle : UNSIGNEDWORD;
                   DevType: Devices;
                   Mode   : InputModes);

(* [V]DI: Input [Locator] [R]e[q]uest Mode *********************************)

PROCEDURE VRqLocator(     Handle: UNSIGNEDWORD;
                          X     : XY;
                          Y     : XY;
                      VAR XOut  : XY;
                      VAR YOut  : XY;
                      VAR Term  : Key);

(* [V]DI: Input [Locator] [S]a[m]ple Mode **********************************)

#if no_set_return
PROCEDURE VSmLocator(    Handle: UNSIGNEDWORD;
                         X     : XY;
                         Y     : XY;
                     VAR XOut  : XY;
                     VAR YOut  : XY;
                     VAR Term  : Key): ANYWORD;
#else
PROCEDURE VSmLocator(    Handle: UNSIGNEDWORD;
                         X     : XY;
                         Y     : XY;
                     VAR XOut  : XY;
                     VAR YOut  : XY;
                     VAR Term  : Key): WORDSET;
#endif

(* [V]DI: Input [Valuator] [R]e[q]uest Mode ********************************)

PROCEDURE VRqValuator(    Handle     : UNSIGNEDWORD;
                          ValuatorIn : UNSIGNEDWORD;
                      VAR ValuatorOut: UNSIGNEDWORD;
                      VAR Terminator : Key);

(* [V]DI: Input [Valuator] [S]a[m]ple Mode *********************************)

PROCEDURE VSmValuator(    Handle: UNSIGNEDWORD;
                          ValIn : UNSIGNEDWORD;
                      VAR ValOut: UNSIGNEDWORD;
                      VAR Term  : Key;
                      VAR Status: UNSIGNEDWORD);

(* [V]DI: Input [Choice] [R]e[q]uest Mode **********************************)

PROCEDURE VRqChoice(    Handle: UNSIGNEDWORD;
                        ChIn  : Key;
                    VAR ChOut : Key);

(* [V]DI: Input [Choice] [S]a[m]ple Mode ***********************************)

PROCEDURE VSmChoice(    Handle: UNSIGNEDWORD;
                    VAR Choice: Key): BOOLEAN;

(* [V]DI: Input [String] [R]e[q]uest Mode **********************************)

PROCEDURE VRqString(    Handle   : UNSIGNEDWORD;
                        MaxLength: SIGNEDWORD;
                        EchoMode : BOOLEAN;
                    VAR PXY      : ARRAY OF XY;
                    VAR Input    : ARRAY OF CHAR);

(* [V]DI: Input [String] [S]a[m]ple Mode ***********************************)

PROCEDURE VSmString(    Handle   : UNSIGNEDWORD;
                        MaxLength: SIGNEDWORD;
                        EchoMode : BOOLEAN;
                    VAR PXY      : ARRAY OF XY;
                    VAR Input    : ARRAY OF CHAR): UNSIGNEDWORD;

(* [V]DI: [S]et [C]ursor [Form] ********************************************)

PROCEDURE VSCForm(    Handle : UNSIGNEDWORD;
                  VAR CurForm: ARRAY OF ANYTYPE);

(* [V]DI: [Ex]change [Tim]er Interrupt [V]ector ****************************)

PROCEDURE VExTimV(    Handle  : UNSIGNEDWORD;
                      Timer   : PROC;
                  VAR OldTimer: PROC;
                  VAR Time    : UNSIGNEDWORD);

(* [V]DI: [Show] [C]ursor **************************************************)

PROCEDURE VShowC(Handle: UNSIGNEDWORD;
                 Reset : BOOLEAN);

(* [V]DI: [Hide] [C]ursor **************************************************)

PROCEDURE VHideC(Handle: UNSIGNEDWORD);

(* [V]DI: [Q]uery [Mouse] Button State *************************************)

PROCEDURE VQMouse(    Handle: UNSIGNEDWORD;
                  VAR Status: BOOLEAN;
                  VAR X     : XY;
                  VAR Y     : XY);

(* [V]DI: [Ex]change [But]ton Change [V]ector ******************************)

PROCEDURE VExButV(    Handle  : UNSIGNEDWORD;
                      UsrCode : PROC;
                  VAR SaveCode: PROC);

(* [V]DI: [Ex]change Mouse [Mot]ion [V]ector *******************************)

PROCEDURE VExMotV(    Handle  : UNSIGNEDWORD;
                      UsrCode : PROC;
                  VAR SaveCode: PROC);

(* [V]DI: [Ex]change [Cur]sor Change [V]ector ******************************)

PROCEDURE VExCurV(    Handle  : UNSIGNEDWORD;
                      UsrCode : PROC;
                  VAR SaveCode: PROC);

(* [V]DI: [Q]uery [Key]board [S]tate ***************************************)

PROCEDURE VQKeyS(    Handle: UNSIGNEDWORD;
                 VAR Status: SpecialKey);

END VInput.
